Imports Microsoft.Xna.Framework
Imports Microsoft.Xna.Framework.Audio
Imports Microsoft.Xna.Framework.Graphics
Imports Microsoft.Xna.Framework.Input
'using Microsoft.Xna.Framework.Input.Touch;
Imports System.Collections.Generic

Public Class Frame
	Public name As String
	Public sound As String
	Public soundLoop As Boolean = False
	Public soundFirstTime As Boolean = False
	'for determine if already sounded for single loop purpose
	Public value As String
	Public type As Enumeration.TypeFrame = Enumeration.TypeFrame.SPRITE
	Public parameter As String

	'public SoundEffect soundEffect = new SoundEffect();
	Public stoppable As Boolean = False
	Public xOffSet As Integer = 0
	Public yOffSet As Integer = 0
	Public raised As Boolean = False
	'for check if the frame is a jump, hang raised in air
	Public delay As Single = 0
	'delay animation frame

	Public Sub PlaySound()
		'Play Sound
		If sound IsNot Nothing Then
			If soundLoop = False Then
				If soundFirstTime = False Then
					soundeffect.Play()
					soundFirstTime = True
				End If
			Else
				soundeffect.Play()
			End If
		End If
	End Sub

	Public ReadOnly Property soundeffect() As SoundEffect
		Get
			Return osoundeffect
		End Get
	End Property
	Private osoundeffect As SoundEffect

	Public ReadOnly Property texture() As Texture2D
		Get
			Return otexture
		End Get
	End Property
	Private otexture As Texture2D


	Public Sub SetSound(value As SoundEffect)
		osoundeffect = value
	End Sub

	Public Sub SetTexture(value As Texture2D)
		otexture = value
	End Sub

	Public Sub New()
	End Sub

	'public enum TypeFrame
	'{
	'    SPRITE,
	'    COMMAND,
	'}

	Public Function DeepCopy() As Frame
		Return DirectCast(Me.MemberwiseClone(), Frame)
	End Function

End Class
